package com.xiaojianone.order.feign.fallback;

import com.xiaojianone.order.feign.ProductFeignClient;
import com.xiaojianone.product.bean.Product;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * ClassName  ProductFeignClientFallback
 * Author  XiaojianOne
 * Date  2025/3/15 21:35
 * Version  8.0
 */

@Component
public class ProductFeignClientFallback implements ProductFeignClient {

    @Override
    public Product getProductById(Long id) {

        System.out.println("兜底回调....");
        Product product = new Product();
        product.setId(id);
        product.setPrice(new BigDecimal("0"));
        product.setProductName("未知商品");
        product.setNum(0);
        return product;
    }
}
